home *** CD-ROM | disk | FTP | other *** search
- /^\/\*/ {
- print ";", substr($0, 4)
- next
- }
-
- /look[fF]rom/ {
- print "from", $2, $3, $4
- print "light point", $2, $3, $4, "mono 0.5"
- next
- }
-
- /look[aA]t/ {
- print "at", $2, $3, $4
- next
- }
-
- /look[uU]p/ {
- print "up", $2, $3, $4
- next
- }
-
- $1 == "fovx" {
- print "fov", $2/2.0, $4/2.0
- print "background black"
- print "ambient white"
- next
- }
-
- /^add object/ {
- name = $3
- nv = 0
- getline
- while ($0 != "end") {
- nv++
- if (nv > 4) {
- print "; polygon", name, "ignored (more than 4 vertices)"
- next
- }
- v[nv] = $2" "$3" "$4" "$5" "$6" "$7
- getline
- }
- getline
- cr = $4
- cg = $5
- cb = $6
- ks = $9
- kd = $10
- getline
- printf "surface %g %g %g mono %g mono %g 0 0\n", cr, cg, cb, kd, ks
- print "triangle normal ; polygon", name
- print v[1]
- print v[2]
- print v[3]
- if (nv == 3) next
- print "triangle normal ; polygon", name, "(part 2)"
- print v[3]
- print v[4]
- print v[1]
- next
- }
-